<%@page import="com.wanmait.hotelManage.vo.Vip"%>
<%@page import="java.util.List"%>
<%@page import="com.wanmait.hotelManage.vo.Roomimages"%>
<%@page import="com.wanmait.hotelManage.vo.Vip"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path=request.getContextPath();
%>
<%
	Vip vip=(Vip)request.getAttribute("vip");
	
%>
<jsp:include page="/manage/inc/header.jsp"/>
<jsp:include page="/manage/inc/menu.jsp"></jsp:include>
 
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i>
            <a href="<%=path%>/manage/index.jsp">首页</a><span class="crumb-step">&gt;</span>
            <a class="crumb-name" href="/jscss/admin/design/">类型管理</a><span class="crumb-step">&gt;</span><span>修改房型</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action="<%=path %>/manage/VipServlet?action=update" method="post" id="myform" name="myform" >
                    <table class="insert-tab" width="100%">
                        <tbody>
                            <tr>
                                <th><i class="require-red">*</i>会员名称：</th>
                                <td>
                                     <input class="common-text required" id="title" name="title" size="20" value="<%=vip.getTitle() %>" type="text"> 
                               <span id="titleMsg"></span>
                                </td>
                            </tr>
                            <tr>
                                <th style="width: 200px;"><i class="require-red">*</i>会员价格：</th>
                                <td><input class="common-text" name="price" id="price" size="5" value="<%=vip.getPrice() %>" type="text">
                                <input type="hidden" id="id" name="id" value="<%=vip.getId()%>">
                                <span id="priceMsg"></span>
                                <input type="hidden" name="vipId" value="<%=vip.getId()%>">
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>会员优惠：</th>
                                <td><input class="common-text" id="discountPrice" name="discount" size="5" value="<%=vip.getDiscount() %>" type="text">
                                <span id="discountPriceMsg"></span>
                                </td>
                            </tr>
                         
                            
                            <!-- 轮播图图片结束 -->
                            
                            <tr>
                                <th></th>
                                <td>
                                    <input id="subBtn" class="btn btn-primary btn6 mr10" value="提交" type="button">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div>

    </div>
    <!--/main-->
</div>

<jsp:include page="/manage/inc/footer.jsp"/>
<script>
	$(function() {
		//热门下拉列表框
		<%-- if(<%=vip.getHot()%>){
			$("#ishot").prop("selected",true);
		}else{
			$("#nothot").prop("selected",true);
		} --%>
		
		//原价验证
		$("#price").blur(function() {
			var price=$(this).val();
			var priceRe=/^\d+(\.\d+)?$/;
			if(!priceRe.test(price)){
				$("#priceMsg").html("您输入的价格有误,请重新输入");
				$(this).select();
			}else{
				$("#priceMsg").empty();
			}
		});
		//折扣价验证
		$("#discountPrice").blur(function() {
			var price=$(this).val();
			var priceRe=/^[0]\d*\.\d*|0\.\d*[1-9]\d*$/;
			if(!priceRe.test(price)){
				$("#discountPriceMsg").html("您输入的价格有误,请重新输入");
				$(this).select();
			}else{
				$("#discountPriceMsg").empty();
			}
		});
		//提交按钮
		$("#subBtn").click(function() {
			var title=$.trim($("#title").val());
			if(title.length==0){
				$("#titleMsg").html("不能为空");
				$("#title").select();
				return;
			}else{
				$("#titleMsg").html("");
			}
			var description=$.trim($("#description").val());
			
			
			$("#myform").submit();
			
		})
	})

</script>